/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package datosempleado;

import java.io.*;

/**
 *
 * @author Javi
 */
public class Empleado extends Trabajador{
    
     private float saldoBruto;
     private float irpf;
     
     public Empleado()throws IOException{

        this.inicializarEmpleado();
    }
     
     /**
     * @return the saldoBruto
     */
    public float getSaldoBruto() {
        return saldoBruto;
    }

    /**
     * @param saldoBruto the saldoBruto to set
     */
    public void setSaldoBruto(float saldoBruto) {
        this.saldoBruto = saldoBruto;
    }

    /**
     * @return the irpf
     */
    public float getIrpf() {
        return irpf;
    }

    /**
     * @param irpf the irpf to set
     */
    public void setIrpf(float irpf) {
        this.irpf = irpf;
    }
   
   public void mostrarEmpleado() {
   
       super.mostrarTrabajador();
       System.out.print("Sueldo Bruto Anual: "+this.getSaldoBruto());
       System.out.print("IRPF: "+this.getIrpf());
   } 


   public void inicializarEmpleado(){
        try {
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
           
            super.inicializarTrabajador();
            String saldoBrutoAux;
            System.out.print("Saldo bruto anual >> ");
            saldoBrutoAux = br.readLine();
            this.saldoBruto = (Float.parseFloat(saldoBrutoAux));
            
            String irpfAux;
            System.out.print("IRPF >> ");
            irpfAux = br.readLine();
            this.irpf = Float.parseFloat(irpfAux);
        } catch (IOException ex) {
            System.err.print("Algun dato no ha sido introducido.");
            System.err.print("El siguiente error ha ocurrido: "+ex.toString());
        }
   }

}
